<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

<script>
// 运算符(操作符)

// 算术运算符
// 加+ 减- 乘* 除/ %取余
// console.log( 1+2 );// 3
// console.log( 5-2 );// 3
// console.log( 5*2 );// 10
// console.log( 5/2 );// 2.5

// console.log( 5/0 );// Infinity
// console.log( 0/5 );// 0

// 余数的正负号,取决于前面这个数的正负号
console.log( 7%4 );// 3 7模4余3
console.log( -7%4 );// -3
console.log( -7%-4 );// -3
console.log( 7%-4 );// 3

console.log( 4%7 );// 4
console.log( -4%7 );// -4
console.log( -4%-7 );// -4
console.log( 4%-7 );// 4

</script>
</body>
</html>